<%--
    Document   : alum_AulaVirtualEnlaces
    Created on : 05/01/2012, 10:35:45 AM
    Author     : Cabrera Abanto, Alan
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page errorPage="../../error.jsp?from=alum_AulaVirtualEnlaces.jsp" %>
<%@ page import="agb.Modelo.GaleriaFotos" %>
<%@ page import="java.util.Vector" %>

<%@page session="true" %>
<%--@taglib uri="/struts-tags" prefix="s"--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
            <link href="/SistemaWebAGB_2.0/dinamica/css/admin_1.css" rel="stylesheet" type="text/css" />
            <link href="/SistemaWebAGB_2.0/dinamica/css/alumno.css" rel="stylesheet" type="text/css" />
            <link href="/SistemaWebAGB_2.0/dinamica/css/style.css" rel="stylesheet" type="text/css" />
       
        <title></title>
        <%
        String mensaje ="";
        mensaje = (String)session.getAttribute("mensaje");
        Vector<GaleriaFotos> LGalerias  = new Vector<GaleriaFotos>();
        LGalerias = GaleriaFotos.listaGalerias();
            
        %>
 <script language="JavaScript">
            function validarDatos() {
                
                galeria = document.frmBuscar.cmbGaleria;
                subgaleria = document.frmBuscar.txtSubGaleria;
                if (subgaleria.value == "") {
                    alert('Debe Ingresar un nombre de Sub Galeria');
                    subgaleria.focus();
                    return false;
                }else{                    
                    if (subgaleria.length >= 23) {
                        alert('Se permite un maximo de 22 caracteres');
                       subgaleria.focus();
                        return false;
                }else{                    
                        if (galeria.selectedIndex == 0) {
                            alert('Debe Seleccionar una Galeria');
                             galeria.focus();
                            
                            return false;
                         }else{
                             return true;
                         }
                    }
                }
            }

                            
                        
                           
                
            
 function imprimir() {
                window.parent.frames[5].focus();
                window.print();
            }

    


        </script>
    </head>
    <body>
        <table width="85%" border="0" cellpadding="0" cellspacing="0">

            <tr>
                <td height="143"></td>
                <td colspan="4" valign="top">
                       <form name="frmBuscar"
                    action="/SistemaWebAGB_2.0/ServletSubida?accion=registraSubGaleria"
                 method="post" target="principal" onsubmit="return validarDatos()">

                           <table align="center" width="80%" border="0" cellpadding="0" cellspacing="0" id="tabla">
                        <!--DWLayoutTable-->
                        
                         <%
                    if(mensaje==null){}else{
                %>
                <tr bgcolor="#ffffff" class="cabecera">
                <td height="10" colspan="2"  align="center"><strong style="color:red"><%=mensaje %>&nbsp; </strong></td>
              </tr>
                
                <%}%>
                         <tr valign="middle">
                            <td height="20" width="25%" align="center" colspan="2" valign="middle" class="cabecera" ><STRONG>REGISTRO SUB GALERIA  &nbsp; </STRONG></td>
                        </tr>
                        
                        
                        <tr valign="middle">
                            <td  width="25%" align="left"  valign="middle"  class="titulo">Nombre: &nbsp; </td>
                            <td valign="middle" align="left" class="contenido">
                                
                               <input name="txtSubGaleria" type="text" style="width:250px" maxlength="22">
                                
                                &nbsp; </td>
                        </tr>
                        <tr valign="middle">
                            <td  width="25%" align="left"  valign="middle"  class="titulo">Galeria: &nbsp;</td>
                            <td valign="middle"  class="contenido" align="left"><label>
                              <select name="cmbGaleria" style="width:250px">
                                <option value="0">Seleccione Galeria...</option>
                                <%for(GaleriaFotos oGaleria : LGalerias){
                                %>
                                    <option value="<%=oGaleria.getCodGaleria()%>"><%=oGaleria.getNombreGaleria()%></option>
                                <%
                                }%>
                              </select>
                            </label>                              &nbsp;
                            </td>
                        </tr> 
                        
                                     
                          <tr valign="middle" class="contenido">
                            <td height="25" width="25%" align="left"  valign="middle" >&nbsp;  </td>
                            <td valign="middle" align="left">                           
                &nbsp;<input type="submit" value="Registrar" />   </td>
                        </tr>
                        </table>
                    </form>
                </td>
            </tr>
            <tr >
                <td height="2">&nbsp;</td>
                <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:window.history.back()">Retornar</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
            </tr>
        </table>
                              <%session.setAttribute("mensaje",null);%>
        </body>

</html>